<?php
/**
 * Miffos framework
 * ----------------------------------------------
 *
 * Copyright (c) 2008, 2009 Martin Sadový (http://sodae.cz)
 *
 * This source file is subject to the "Miffos license" that is bundled
 * with this package in the file license.txt.
 *
 * @copyright  Copyright (c) 2008, 2009 Martin Sadový
 * @license    license.txt
 * @link       http://miffos.sodae.cz
 * @package    miffos
 * @version    $Id$
 */

  class FormCheckboxInput extends FormInputExtends
  {
    protected $type = 'checkbox';

    protected $label = 'label';

    public function __construct($form, $name,$label,$check)
    {
        parent::__construct($form, $name, $label);
        $this->element->checked($check);
        $this->element->id($name.'-checkbox');
        $this->label->for($name.'-checkbox');
    }

    public function setValue($value)
    {
        $this->element->checked((bool) $value);
        parent::setValue( (bool) $value );
    }
    
  }
  
  
?>